import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/stm/swstpettymoneycheck/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/stm/swstpettymoneycheck',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/stm/swstpettymoneycheck/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/stm/swstpettymoneycheck/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/stm/swstpettymoneycheck',
    method: 'put',
    data: obj
  })
}

// 查询备用金盘点非驳回数据
export function getPettymoneyCheck(date) {
  return request({
    url: '/stm/swstpettymoneycheck/getPettymoneyCheck?checkTime='+date,
    method: 'get'
  })
}
// 查询备用金盘点数据
export function getPettymoneyCheckEdit(id,date) {
  return request({
    url: '/stm/swstpettymoneycheck/getPettymoneyCheckEdit?id='+id+"&checkTime="+date,
    method: 'get'
  })
}

// 获取备用金盘点日期
export function getTypeValue(query) {
  return request({
    url: '/admin/dict/type/pettymoney_check_day',
    method: 'get',
    params: query
  })
}

// 新增或保存备用金盘点数据
export function saveOrUpdate(query) {
  return request({
    url: "/stm/swstpettymoneycheck/saveOrUpdate",
    method: "post",
    data: query
  });
}

// 提交
export function submitObj(obj) {
  return request({
    url: '/stm/swstpettymoneycheck/modify/submit/status',
    method: 'put',
    params: obj
  })
}

// 批量删除
export function batchDelete(ids) {
  return request({
    url: '/stm/swstpettymoneycheck/batchDelete',
    method: 'post',
    data: ids
  })
}

// 中心站长审核
export function approvalObj(obj) {
  return request({
    url: '/stm/swstpettymoneycheck/modify/approval/status',
    method: 'put',
    params: obj
  })
}

// 中心站长驳回
export function rejectObj(obj) {
  return request({
    url: '/stm/swstpettymoneycheck/modify/reject/status',
    method: 'put',
    params: obj
  })
}

// 导出--单个车站
export function exportExcel(query) {
  return request({
    url: "/stm/swstpettymoneycheck/exportPettymoneyCheckForStation",
    method: "post",
    data: query,
    responseType: "blob",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

